package com.yict.csms.system.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.LinkedHashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import com.yict.csms.baseInfo.entity.ContractType;
import com.yict.csms.company.entity.Company;

@Entity
@Table(name = "CSMS_COST")
public class Cost implements Serializable {

	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "csms_cost_seq")
	@SequenceGenerator(name = "csms_cost_seq", sequenceName = "SEQ_CSMS_COST", allocationSize = 1, initialValue = 1)
	@Column(name = "COSTID")
	private Long costid;
	@Column(name = "COMPANYID")
	private Long companyid;
	@Column(name = "SOURCE")
	private String source;
	@Column(name = "COSTTYPE")
	private String costtype;
	@Column(name = "MACHINE")
	private String machine;
	@Column(name = "TYPEID")
	private Long typeid;
	@Column(name = "PROFEID")
	private Long profeid;
	@Column(name = "STATIONID")
	private Long stationid;
	@Column(name = "SOURCETABLE")
	private String sourcetable;
	@Column(name = "SOURCEID")
	private Long sourceid;
	@Column(name = "SERVICEDATE")
	private Date servicedate;
	@Column(name = "SERVICEBEGINTIME")
	private Date servicebegintime;
	@Column(name = "SERVICEENDTIME")
	private Date serviceendtime;
	@Column(name = "SERVICETIME")
	private String servicetime;
	@Column(name = "WORKHOUR")
	private BigDecimal workhour;
	@Column(name = "DEDUCTWORKHOUR")
	private BigDecimal deductworkhour;
	@Column(name = "DEDUCTREASON")
	private String deductreason;
	@Column(name = "QUANTITY")
	private BigDecimal quantity;
	@Column(name = "ALLWORKHOURS")
	private BigDecimal allworkhours;
	@Column(name = "ALLWORKQUANTITY")
	private BigDecimal allworkquantity;
	@Column(name = "ALLCURRENCY")
	private String allcurrency;
	@Column(name = "ALLCOST")
	private BigDecimal allcost;
	@Column(name = "REMARKS")
	private String remarks;
	@Column(name = "CONFIRMDATE")
	private Date confirmdate;
	@Column(name = "COSTDATE")
	private Date costdate;
	@Column(name = "ACCOUNTMETHOD")
	private String accountmethod;
	@Column(name = "COSTGROUP")
	private Long costgroup;
	@Column(name = "COSTCONFIRMPERSON")
	private Long costconfirmperson;
	@Column(name = "STATUS")
	private String status;
	@Column(name = "RATECURRENCY")
	private String ratecurrency;
	@Column(name = "RATE")
	private BigDecimal rate;
	@Column(name = "HOLIDAY_ADD")
	private BigDecimal holidayAdd;
	@Column(name = "UNIT")
	private String unit;
	@Column(name = "CHECKNO")
	private String checkno;
	
	@Column(name = "BUDGETNUM")
	private Long budgetnum;
	
	@Column(name = "CREATEPERSON")
	private Long createperson;
	@Column(name = "CREATEDATE")
	private Date createdate;
	@Column(name = "UPDATEPERSON")
	private Long updateperson;
	@Column(name = "UPDATEDATE")
	private Date updatedate;
	
	@Column(name = "COST_USER")
	private Long costUser;
	@Column(name = "COST_CONFIRM_DATE")
	private Date costConfirmDate;
	@Column(name = "CANCEL_COST_USER")
	private Long cancelCostUser;
	@Column(name = "CANCEL_COST_DATE")
	private Date cancelCostDate;
	
	public Long getCostid() {
		return costid;
	}
	public void setCostid(Long costid) {
		this.costid = costid;
	}
	public Long getCompanyid() {
		return companyid;
	}
	public void setCompanyid(Long companyid) {
		this.companyid = companyid;
	}
	public String getSource() {
		return source;
	}
	public void setSource(String source) {
		this.source = source;
	}
	public String getCosttype() {
		return costtype;
	}
	public void setCosttype(String costtype) {
		this.costtype = costtype;
	}
	public String getMachine() {
		return machine;
	}
	public void setMachine(String machine) {
		this.machine = machine;
	}
	public Long getTypeid() {
		return typeid;
	}
	public void setTypeid(Long typeid) {
		this.typeid = typeid;
	}
	public Long getProfeid() {
		return profeid;
	}
	public void setProfeid(Long profeid) {
		this.profeid = profeid;
	}
	public Long getStationid() {
		return stationid;
	}
	public void setStationid(Long stationid) {
		this.stationid = stationid;
	}
	public String getSourcetable() {
		return sourcetable;
	}
	public void setSourcetable(String sourcetable) {
		this.sourcetable = sourcetable;
	}
	public Long getSourceid() {
		return sourceid;
	}
	public void setSourceid(Long sourceid) {
		this.sourceid = sourceid;
	}
	public Date getServicedate() {
		return servicedate;
	}
	public void setServicedate(Date servicedate) {
		this.servicedate = servicedate;
	}
	public Date getServicebegintime() {
		return servicebegintime;
	}
	public void setServicebegintime(Date servicebegintime) {
		this.servicebegintime = servicebegintime;
	}
	public Date getServiceendtime() {
		return serviceendtime;
	}
	public void setServiceendtime(Date serviceendtime) {
		this.serviceendtime = serviceendtime;
	}
	public String getServicetime() {
		return servicetime;
	}
	public void setServicetime(String servicetime) {
		this.servicetime = servicetime;
	}
	public BigDecimal getWorkhour() {
		return workhour;
	}
	public void setWorkhour(BigDecimal workhour) {
		this.workhour = workhour;
	}
	public BigDecimal getDeductworkhour() {
		return deductworkhour;
	}
	public void setDeductworkhour(BigDecimal deductworkhour) {
		this.deductworkhour = deductworkhour;
	}
	public String getDeductreason() {
		return deductreason;
	}
	public void setDeductreason(String deductreason) {
		this.deductreason = deductreason;
	}
	public BigDecimal getQuantity() {
		return quantity;
	}
	public void setQuantity(BigDecimal quantity) {
		this.quantity = quantity;
	}
	public BigDecimal getAllworkhours() {
		return allworkhours;
	}
	public void setAllworkhours(BigDecimal allworkhours) {
		this.allworkhours = allworkhours;
	}
	public BigDecimal getAllworkquantity() {
		return allworkquantity;
	}
	public void setAllworkquantity(BigDecimal allworkquantity) {
		this.allworkquantity = allworkquantity;
	}
	public String getAllcurrency() {
		return allcurrency;
	}
	public void setAllcurrency(String allcurrency) {
		this.allcurrency = allcurrency;
	}
	public BigDecimal getAllcost() {
		return allcost;
	}
	public void setAllcost(BigDecimal allcost) {
		this.allcost = allcost;
	}
	public String getRemarks() {
		return remarks;
	}
	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}
	public Date getConfirmdate() {
		return confirmdate;
	}
	public void setConfirmdate(Date confirmdate) {
		this.confirmdate = confirmdate;
	}
	public Date getCostdate() {
		return costdate;
	}
	public void setCostdate(Date costdate) {
		this.costdate = costdate;
	}
	public String getAccountmethod() {
		return accountmethod;
	}
	public void setAccountmethod(String accountmethod) {
		this.accountmethod = accountmethod;
	}
	public Long getCostgroup() {
		return costgroup;
	}
	public void setCostgroup(Long costgroup) {
		this.costgroup = costgroup;
	}
	public Long getCostconfirmperson() {
		return costconfirmperson;
	}
	public void setCostconfirmperson(Long costconfirmperson) {
		this.costconfirmperson = costconfirmperson;
	}
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	public String getRatecurrency() {
		return ratecurrency;
	}
	public void setRatecurrency(String ratecurrency) {
		this.ratecurrency = ratecurrency;
	}
	public BigDecimal getRate() {
		return rate;
	}
	public void setRate(BigDecimal rate) {
		this.rate = rate;
	}
	public String getUnit() {
		return unit;
	}
	public void setUnit(String unit) {
		this.unit = unit;
	}
	public String getCheckno() {
		return checkno;
	}
	public void setCheckno(String checkno) {
		this.checkno = checkno;
	}
	public Long getBudgetnum() {
		return budgetnum;
	}
	public void setBudgetnum(Long budgetnum) {
		this.budgetnum = budgetnum;
	}
	public Long getCreateperson() {
		return createperson;
	}
	public void setCreateperson(Long createperson) {
		this.createperson = createperson;
	}
	public Date getCreatedate() {
		return createdate;
	}
	public void setCreatedate(Date createdate) {
		this.createdate = createdate;
	}
	public Long getUpdateperson() {
		return updateperson;
	}
	public void setUpdateperson(Long updateperson) {
		this.updateperson = updateperson;
	}
	public Date getUpdatedate() {
		return updatedate;
	}
	public void setUpdatedate(Date updatedate) {
		this.updatedate = updatedate;
	}
	public Long getCostUser() {
		return costUser;
	}
	public void setCostUser(Long costUser) {
		this.costUser = costUser;
	}
	public Date getCostConfirmDate() {
		return costConfirmDate;
	}
	public void setCostConfirmDate(Date costConfirmDate) {
		this.costConfirmDate = costConfirmDate;
	}
	public Long getCancelCostUser() {
		return cancelCostUser;
	}
	public void setCancelCostUser(Long cancelCostUser) {
		this.cancelCostUser = cancelCostUser;
	}
	public Date getCancelCostDate() {
		return cancelCostDate;
	}
	public void setCancelCostDate(Date cancelCostDate) {
		this.cancelCostDate = cancelCostDate;
	}
	
	public BigDecimal getHolidayAdd() {
		return holidayAdd;
	}
	public void setHolidayAdd(BigDecimal holidayAdd) {
		this.holidayAdd = holidayAdd;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((costid == null) ? 0 : costid.hashCode());
		return result;
	}
	
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Cost other = (Cost) obj;
		if (costid == null) {
			//if (other.costid != null)
				return false;
		} else if (!costid.equals(other.costid))
			return false;
		return true;
	}
}
